<include file="Public:header" />
<!-- MAIN CONTENT start -->
<literal>
    <style>
        .table th, .table td {
            text-align: center;
            /*height:38px;*/
        }
        .badge-star{
            background: #D2D0E2;
        }
    </style>
</literal>
<div class="span12">
    <div class="well">
        <span>TAG:</span>
        <empty name="tag">
            <span class="label">全部</span>
        <else/>
            <a href="{:U('/Problem/index')}"><span class="label label-info">全部</span></a>
        </empty>
        <notempty name="tags">
            <foreach name="tags" item="tag_v">
                <if condition=" $tag eq $tag_v['id']">
                    <span class="label">{$tag_v.tag}</span>
                    <else/>
                    <a href="{:U('/Problem/index',array('tag'=>$tag_v['id']))}">
                        <span class="label label-info"><strong>{$tag_v.tag}</strong></span>
                    </a>
                </if>
            </foreach>
        </notempty>
    </div>
    <div class="well blank-slate">
        <!--<h3>Problem List</h3>-->
        <form class="form-search">
            <label for="problem_id">问题ID：</label>
            <input class="input-medium" type="text" name="problem_id" placeholder="多个ID逗号隔开" value="{$problem_id}"/>
            <label for="key">关键字：</label><input class="input-medium" type="text"  name="keywords"placeholder="关键字" value="{$keywords}"/>
            <label for="difficulty">题目难度：</label>
            <select class="input-medium" name="difficulty">
                <option value="-1" <if condition="$language === -1 ">selected</if> >All</option>
                <option value="0" <if condition=" $difficulty eq 0">selected</if>>No star</option>
                <option value="1" <if condition=" $difficulty eq 1">selected</if>>1 Star</option>
                <option value="2" <if condition=" $difficulty eq 2">selected</if>>2 Stars</option>
                <option value="3" <if condition=" $difficulty eq 3">selected</if>>3 Stars</option>
                <option value="4" <if condition=" $difficulty eq 4">selected</if>>4 Stars</option>
                <option value="5" <if condition=" $difficulty eq 5">selected</if>>5 Stars</option>
            </select>
            <button type="submit" class="btn">
                <i class="icon-search"></i>Go!
            </button>
        </form>
        <table class="table table-striped table-bordered table-hover">
            <thead>
            <tr>
                <th>题目编号</th>
                <th>标题</th>
                <th>来源</th>
                <th>正确</th>
                <th>提交</th>
                <th>难度</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="v">
                <tr>
                    <td>
                        {$v.problem_id}
                    </td>
                    <td>
                        <a href="{:U('/Problem/viewProblem',array('id'=>$v[problem_id]))}">{$v.title}</a>
                    </td>
                    <td>
                        {$v.source}
                    </td>
                    <td>

                        <a href="{:U('Status/index',array('problem_id'=>$v['problem_id'],'result'=>4))}">
                            <span class="badge badge-important">{$v.accepted}</span>
                        </a>

                    </td>
                    <td>
                        <a href="{:U('Status/index',array('problem_id'=>$v['problem_id']))}">
                            <span class="badge badge-info">{$v.submit}</span>

                        </a>
                    </td>
                    <td>
                        <span class="badge badge-star">
                            <empty name="v.difficult">

                                <for start="0" end="5" step="1">
                                    <i class="icon-white icon-star"></i>
                                </for>
                                <else/>
                                <for start="0" end="$v.difficult" step="1">
                                    <i class="icon-star"></i>
                                </for>
                                <for start="$v.difficult" end="5" step="1">
                                    <i class="icon-white icon-star"></i>
                                </for>
                            </empty>
                        </span>
                    </td>
                </tr>
            </foreach>
            <tr>
                <td colspan="6" align="center"> {$page}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<!-- MAIN CONTENT end-->
<include file="Public:footer" />